<?php

require_once 'classes/Hospital.class.php';

$objHospital 		= new Hospital();
$arrobjHospital 	= $objHospital->fetchAllHospital();


// display( $arrobjPatients ); exit;

if( false == valArr( $arrobjHospital ) ) {
	echo '<h2>Hospital Info Not avaliable.</h2>';
} else {
?>
<link href="css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
<script src="js/plugins/dataTables/jquery.dataTables.js"></script>
<script src="js/plugins/dataTables/dataTables.bootstrap.js"></script>
<script src="js/bootstrap-confirmation.js" type="text/javascript"></script>
<script>
	$(document).ready(function() {
		$('#dataTables-example').dataTable();
	});
</script>
<style>
	.thclass{
	font-size:12px;
	}
	.tbclass{
	font-size:12px;
	}
</style>

<div id="insideTabs1">
	<ul id="insideTabsMenu">
		<li><a class="int_tab" id="act" href="modules.php?file=hospital&mid=<? echo $mid;?>&smid=<? echo $smid;?>" >Add Hospital Info</a></li>
	</ul>  
</div>
	
<div class="col-lg-12">
	<div class="panel panel-primary">
		
		<div class="panel-heading"><i class="fa fa-bell fa-fw"></i>Hospital Info</div>
		<div class="panel-body">
			<div class="table-responsive">
				<table class="table table-striped table-bordered table-hover" id="dataTables-example">
					<thead class="thclass">
						<tr>
							<th>Sr.No</th>
							<th>Name</th>
							<th>Phone</th>
							<th>Address</th>
							<th>Pincode</th>
							<th>Email</th>
							<th>Website</th>
							<th>Edit</th>
							<th>Delete</th>
					</thead>
					<tbody class="tbclass">
					<?php 
					$intSnCount = 1;
					foreach( $arrobjHospital as $objHospital ) {
							$n++;
					?>
							<tr class="odd gradeX">
							<td><?  echo $intSnCount; ?></td>
							<td><? echo $objHospital->getName(); ?></td>
							<td><? echo $objHospital->getPrimaryPhoneNumber(); ?></td>
							<td><? echo $objHospital->getAddressDetails(); ?></td>
							<td><? echo $objHospital->getPinCode(); ?></td>
							<td><? echo $objHospital->getEmailAddress(); ?></td>
							<td><? echo $objHospital->getWebUrl(); ?></td>
							<td>
								<a href="modules.php?file=hospital&hospital_id=<? echo $objHospital->getId(); ?>&mid=<? echo $mid;?>&smid=<? echo $smid;?>" title="Update patient information"><img src="images/icons/update.png" width="25" height="25"></a>
							</td>
							<td>
								<a href="modules.php?file=hospital&hospital_id=<?echo $objHospital->getId();?>&mid=<? echo $mid; ?>&smid=<? echo $smid;?>" title="delete_diagnosis_type"><img src="images/icons/delete.jpg" width="25" height="25"></a>
							</td>
							</tr>
					<?
					} 
					?>
					</tbody>
				</table>
			</div>
		</div>
	</div>
</div>
<?php
}
?>